package org.zjx.data.screen;

import org.zjx.command.entity.screen.*;
import org.zjx.command.enums.TeleportType;
import org.zjx.data.BaseSceneBuilder;

import java.awt.*;

public class JianYeSceneBuilder extends BaseSceneBuilder {

    @Override
    protected String getSceneName() {
        return "建邺城";
    }

    @Override
    protected Dimension getSceneSize() {
        return new Dimension(287, 143);
    }

    @Override
    protected void addMonsters() {

    }

    @Override
    protected void addNpcs() {
        // 添加所有NPC
        addNpc("宠物仙子", new Point(63, 115));
        addNpc("陈长寿", new Point(219, 123));
        addNpc("超级巫医", new Point(211, 98));
        addNpc("超级巫医", new Point(104, 55));
        addNpc("装备收购商", new Point(243, 118));
        addNpc("装备鉴定人", new Point(250, 115));
        addNpc("海产收购商", new Point(231, 130));
        addNpc("技能指导师", new Point(72, 82));
        addNpc("吹牛王", new Point(90, 111));
        addNpc("迎客僧", new Point(8, 55));
        addNpc("戏班老板", new Point(86, 114));
        addNpc("赵元宝", new Point(228, 64));
        addNpc("雷黑子", new Point(73, 10));
        addNpc("罗招弟", new Point(220, 116));
        addNpc("小花", new Point(207, 36));
        addNpc("刘老爹", new Point(37, 27));
        addNpc("教书先生", new Point(78, 89));
        addNpc("符全", new Point(19, 91));
        addNpc("赵捕头", new Point(117, 71));
        addNpc("老胡", new Point(51, 30));
        addNpc("飞儿", new Point(105, 106));
        addNpc("老孙头", new Point(223, 132));
        addNpc("牛大胆", new Point(230, 109));
        addNpc("王大嫂", new Point(141, 132));
        addNpc("管家", new Point(32, 86));
        addNpc("马全有", new Point(52, 49));
        addNpc("建邺邺守卫", new Point(12, 7));
        addNpc("勾魂马面", new Point(283, 75));
        addNpc("张来福", new Point(87, 73));
        addNpc("推广登记员", new Point(10, 77));
    }

    @Override
    protected void addRooms() {
        // 创建所有房间
        Room bingTieShop = createRoom("兵铁铺", null);
        addNpcToRoom(bingTieShop, "武器店掌柜", new Point(11, 8));
        addNpcToRoom(bingTieShop, "武器店老板", new Point(14, 10));
        rooms.add(bingTieShop);

        Room liJiCloth = createRoom("李记布庄", null);
        addNpcToRoom(liJiCloth, "服装店老板", new Point(19, 13));
        rooms.add(liJiCloth);

        Room huiChunBranch = createRoom("回春堂分店", null);
        addNpcToRoom(huiChunBranch, "药店老板", new Point(21, 15));
        rooms.add(huiChunBranch);

        Room dongShengWarehouse = createRoom("东升货栈", null);
        addNpcToRoom(dongShengWarehouse, "货栈老板", new Point(30, 10));
        rooms.add(dongShengWarehouse);

        Room heShengJi = createRoom("合生记", null);
        addNpcToRoom(heShengJi, "当铺老板", new Point(23, 10));
        rooms.add(heShengJi);

        Room wanYuBank = createRoom("万宇钱庄", null);
        addNpcToRoom(wanYuBank, "钱庄老板", new Point(31, 14));
        rooms.add(wanYuBank);

        Room jianYeHouse1 = createRoom("建邺邺民居", null);
        addNpcToRoom(jianYeHouse1, "李善人", new Point(28, 10));
        rooms.add(jianYeHouse1);

        Room jianYeHouse2 = createRoom("建邺邺民居", null);
        addNpcToRoom(jianYeHouse2, "周猎户", new Point(22, 15));
        rooms.add(jianYeHouse2);

        Room jianYeYamen = createRoom("建邺邺衙门", null);
        addNpcToRoom(jianYeYamen, "建邺邺县令", new Point(33, 19));
        addNpcToRoom(jianYeYamen, "简师爷", new Point(28, 21));
        addNpcToRoom(jianYeYamen, "衙役", new Point(24, 19));
        rooms.add(jianYeYamen);
    }

    @Override
    protected void addTeleports() {
        // 场景传送点
        addSceneTeleport(new Point(238, 128), "东海湾", new Point(7, 84), new Point(245, 136));
        addSceneTeleport(new Point(270, 31), "东海湾", new Point(8, 8), new Point(276, 33));

        // NPC传送点
        addNpcTeleport("驿站老板", new Point(148, 54), "江南野外", new Point(12, 4), new Point(154, 56));

        // 房间入口传送点
        addRoomTeleport(new Point(120, 127), "东升货栈", new Point(25, 5), new Point(117, 129));
        addRoomTeleport(new Point(7, 79), "建邺民居", new Point(30, 9), new Point(5, 83));
        addRoomTeleport(new Point(75, 10), "兵铁铺", new Point(14, 7), new Point(77, 13));
        addRoomTeleport(new Point(143, 80), "建邺衙门", new Point(15, 11), new Point(145, 83));
        addRoomTeleport(new Point(125, 39), "合生记", new Point(15, 6), new Point(128, 41));
        addRoomTeleport(new Point(233, 76), "万宇钱庄", new Point(22, 9), new Point(236, 79));
        addRoomTeleport(new Point(244, 20), "建邺民居", new Point(27, 8), new Point(241, 22));
        addRoomTeleport(new Point(220, 5), "回春堂分店", new Point(25, 6), new Point(218, 8));
        addRoomTeleport(new Point(168, 33), "李记布庄", new Point(13, 6), new Point(170, 36));
    }

    public static void main(String[] args) {
        new JianYeSceneBuilder().execute("jianye_scene.json", "建邺城");
    }
}